package com.wish233.loadbalance.factory;

import com.wish233.loadbalance.LoadBalancer;
import com.wish233.loadbalance.impl.RoundRobinLoadBalancer;
import com.wish233.spi.SpiLoader;

/**
 * 负载均衡器工厂类
 *
 * @author WHH
 */
public class LoadBalancerFactory {

    static {
        SpiLoader.load(LoadBalancer.class);
    }

    /**
     * 默认
     */

    private final LoadBalancer DEFAULT_LOAD_BALANCER = new RoundRobinLoadBalancer();

    public static LoadBalancer getInstance(String key) {
        return SpiLoader.getSpiInstance(LoadBalancer.class, key);
    }

}
